package com.mayikt.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String APP_ID = "2016102200736064";

    // 商户私钥，您的PKCS8格式RSA2私钥，这些就是我们刚才设置的
    public static String MERCHANT_PRIVATE_KEY = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC1SdvSm4ldEfTo8F/hECE1rtdjXmp02hLI2PASMKXrVUwkyLVqVRSz9jlsXYcmLX45pYOq777a1CD9vUBDH3ZXtciavr960rtkt2l0pPSRsDjwN8r9A7qx9iSuWKGfViVE6VU1bq1EAAL364jOPnh//jwvYOHj5RV69SP9E4ldxDNVqCPLzFFbrkM2aR0RC4F4EXUTBVXh6kBkO4hM+em6piQFiz1dkaRdIm62lo557uOfhD3rHke+ZV88tAreu1mjNlhvftademl0EuYbmOOhBVZVazREHNnkfRwt+qahD7FbsZVmNVXROuYl69OrHFj6dbta0JLBKoR5++30YwwbAgMBAAECggEBAKT8vu6BVxY4zWdhvCCcCV1N7gAlYUVPYmEf7fzgAWCXlGC1uUU4gUr2/3O7+s+n/4R/OcFLx6pn/E5w+hccfxt7+UG774/cUWdr9LGPnnUop+kXHcn+pt5nYSK6zvyv7eM1Z7LlMxL737e5yBvLhucVfbiwt2QsjMwGZeZg7VdDOn9lEZRNZK9Wv6l2t4gxTIEk84fMTN+/NEnNjFxAIP5TfZjoIrvmj5y5xjXP3Vbb7Gff4FRZEY5TBGEqeTGLUpFoBjvt46qxrb0N/0QRhy3n9eNJ+o4YeQcZliifNLG2LNFRgQEMclq3PH4n9/O+roTfCAkC9G0reUMjvlqT6yECgYEA7OtHDa1wYSTdsLLL/Wq5ZlxZwLLs7dvhJRthACcpbBOjFKUeWiiVjWtTFLqZzR/+HqwqVWUeYttENoE/mx5F3uSuG+zrfoyFKPfGN0EkCVKnKkuSX8Dn4BCRCe6dwKaduqgTXh0Lks/iF2bdUW5ybjcXDkr8xOuZg3XDOMh5q38CgYEAw+Obra0wRkbep6FoewrfjfAnn5TAgCUpauhtYdZFP6nXuh2zc6VLs8PYBrOYi9NIQ2o1LxXMFqTs67tOI/yqryyArwqiuo9C2hBCVDqdL1O+zCNk86fq3PPCMRtn92aCPuonCgknEZ+iStWhnenznKGO7tEvCA1dVVqx8gqLHWUCgYEAmAM2Kd541rvSyodOP6F0p+rlY7DqOIv2X9q7WF/IQiIvZxWy7eJQYtbUDd7UxDqc0I1i9DvXTVKm59nyN9MqvaM4244eY6pB3lFsixNuzdSMkaS/nFSn8qpuhVLnQS8m0Rb6pk44mNBtntpPcupM3c7XKkKPAMKyUxkCU7K97n0CgYAd3a32pNkfXd7EoA9V8ypycZMY+Yz//Kp76kQDDrAwLKz/a1fY4fLQzaM6Ile3udbisGa7bw9WxH560mvvgK5lVtun1G9LElyW8rOqM+WTOal1ZlAV9hwQ4/lPk2YeijqBbSHWnd6fCT+tOTUS5oCF+PvZ3XrWN3NreBB5XrInIQKBgQDSIBFBX1RbZsZBp7slkXVPRQ9ob3lJW+4PJ4/n/MKInqj29Mu7VF1Yqt31B7FSgS9BwVsu43UmHoVH/e+rp6seJpk104pFNu7KVvfY/pOu9cADfVjIOd8EcU6pA++XObzVcoEJLI6Qv873bDwS2t2S1ZDpvYGMk+loEuuFUZQzTQ==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。，这些就是我们刚才设置的
    public static String ALIPAY_PUBLIC_KEY ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoClN+iYOZac2IVqg9bYZN+JMoCzzAqQCUXcSFQ3K23LcdbUA3usrQvP5+Bg3UjY57Ke3MxwCVgzq7/HhASSF3z9VT5mQF+yL9ELHctnNV858aSnMG+sltYeGuxRtrraG1y5ot1DOmOswZWsGzvq4zpTPzP4b4NVkiOyos4tRky76NKnsJgzv+uB5X+GXc+nNGbjoackrS3Uajp0jb5jCM8rUrMqzyPoQz3RKNu5FmSsliJkXDPvTbkRAzKr1jIGisUjM+LikoilPzpFcrnK/CzwKu4hhYDvbm1YfLlduk2qrAVbmIa7Zi1PJC0O2smQUZjBgAC7qCzLXKlyPHUbtGwIDAQAB";
    //异步通知，再这里我们设计自己的后台代码
    public static String notify_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String SIGN_TYPE = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关
    public static String GATEWAYURL = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String LOG_PATH = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(LOG_PATH + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
